// 声明全局 $request 类型
declare const $request: {
  get: (options: { url: string; params?: any }) => Promise<any>
  post: (options: { url: string; params?: any }) => Promise<any>
}

// 园区企业信息接口
export interface ParkEnterpriseInfo {
  id: number
  name: string
  intro: string
  coverImage: string
  companyTypeTag: string
  // 以下字段可能在其他接口中返回
  enterpriseCode?: string
  contactPerson?: string
  contactPhone?: string
  contactEmail?: string
  address?: string
  description?: string
  businessScope?: string
  registrationTime?: string
  status?: boolean
  sort?: number
  createTime?: string
  updateTime?: string
}

// 园区企业列表响应接口
export interface ParkEnterpriseListResponse {
  list: ParkEnterpriseInfo[]
  total: number
  page: number
  limit: number
  totalPage: number
}

// API响应包装接口
export interface ApiResponse<T> {
  code: number
  message: string | null
  data: T
}

// 分页查询参数接口
export interface ParkEnterprisePageQuery {
  page: number
  limit: number
  keyword?: string
  status?: number
}

/**
 * 获取园区企业分页列表
 * @param params 查询参数
 * @returns 园区企业列表数据
 */
export const getParkEnterpriseListApi = (params: ParkEnterprisePageQuery) => {
  return $request.get({ url: 'front/park/enterprise/list', params })
}

/**
 * 获取园区企业详情
 * @param id 企业ID
 * @returns 园区企业详情数据
 */
export const getParkEnterpriseDetailApi = (id: number) => {
  return $request.get({ url: `front/park/enterprise/detail/${id}` })
}
